<?php

/**
 * @author extintor
 * @copyright 2012
 */

require "resources/config.php";

//$db=new dbConnection();
$iu=new indexUtil();

//echo typeof($db);

/*
$t=file_get_contents("sample.txt");

$words=$iu->getUniqueWords($t);
$lemmas=$iu->getUniqueLemmas($words);



print_r($words);

print_r($lemmas);
*/
$idx=new indexer();

$f="sample1.txt";
echo "Indexando $f ...\n";
$t=file_get_contents($f);
$li=$idx->indexDocument($f,$t);

$f="sample2.txt";
echo "Indexando $f ...\n";
$t=file_get_contents($f);
$li=$idx->indexDocument($f,$t);

$f="sample3.txt";
echo "Indexando $f ...\n";
$t=file_get_contents($f);
$li=$idx->indexDocument($f,$t);

$f="sample4.txt";
echo "Indexando $f ...\n";
$t=file_get_contents($f);
$li=$idx->indexDocument($f,$t);

$f="sample5.txt";
echo "Indexando $f ...\n";
$t=file_get_contents($f);
$li=$idx->indexDocument($f,$t);

echo "Finished!";

//$db->exec("insert into word values (1,'prueba')");

?>